//SponzaScene
//Created: 07/01/14
//Created By Daniel Bowler
//
//Loads and renders the sponza scene. 


#pragma once

#include "AbstractScene.h"

#define NUM_LIGHTS_SPONZA 1024*2

class StaticModel;
class SkyDome;

class SponzaScene : public AbstractScene
{
public: 
	//Constructor and Destructor. Constructor will be used
	//to init the classes variables (and any pointers to NULL) but leave
	//dynamic allocation to the InitDynamicData() - unless absolutly required
	SponzaScene();
	~SponzaScene();

	//Override the init and dealloc functions
	void OpenScene();
	void CloseScene();

	//Override the mouse input functions
	void OnMouseDown(WPARAM btnState, int x, int y, UINT originalMessage);
	void OnMouseUp(WPARAM btnState, int x, int y, UINT originalMessage);
	void OnMouseMove(WPARAM btnState, int x, int y);

	//Override OnResize function. 
	void OnResize();

	//Override the render and update functions
	void UpdateWithDelta(float delta);
	void RenderScene();
private:
	//Sponza Scene
	StaticModel* sponza;

	//SkyDome.
	SkyDome* skyDome;

	//Scene State.
	enum SceneState 
	{ 
		SCENE_STATE_DRAW_SCENE,						//Draws as usual
		SCENE_STATE_DRAW_Z_PRE_PASS_DEPTH_BUFFER,   //Draws depth buffer as full screen quad.
		SCENE_STATE_DRAW_CS_MAX_Z_DEPTH_BUFFER,     //(Optional) Draws tile max z Buffer.
		SCENE_STATE_DRAW_CS_LLSEB_GREYSCALE,		//Visualise how many lights affect a tile. 
		SCENE_STATE_DRAW_CS_LLSEB_COLOUR,           //As above, but with more colour.
		SCENE_STATE_DRAW_CS_LLSEBT_GREYSCALE,       //Transparant tiles - greyscale.
		SCENE_STATE_DRAW_CS_LLSEBT_COLOUR			//Transparant tiles - colour
	};
	//Scene State - what to render?
	SceneState sceneState;
	//Should render lights?
	bool shouldRenderLights;

	//Directional Light
	DirectionalLight dLight;
	//Should use directional light to light the scene?
	bool shouldUseDLight;
};